Skip to content

Add web-based AI conference assistant example with chat UI and batch note creation#50

Draft
Copilot wants to merge 8 commits intodevelopfrom
copilot/create-upload-session-chat-interface
Draft

Add web-based AI conference assistant example with chat UI and batch note creation#50
Copilot wants to merge 8 commits intodevelopfrom
copilot/create-upload-session-chat-interface

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Web-based AI chat interface for generating HackMD book-mode conference notes. Users provide API keys from the browser, upload session data, preview generated markdown, then batch-create notes with rate-limit-aware progress tracking.

Architecture

  • Next.js 16 + Vercel AI SDK v6TextStreamChatTransport for streaming chat, streamText with tool-use on the server
  • No server-side secrets — HackMD API key, OpenAI key, and team path all provided from the frontend setup panel
  • HackMD API via fetch wrapper (src/lib/hackmd-client.ts) — avoids bundling axios into the serverless runtime

AI Tools (src/lib/tools.ts)

Tool Purpose
hackmd_get_me Verify credentials, discover teams
hackmd_get_note Read existing notes for format reference
hackmd_get_team_notes List team workspace notes
jq_query Token-efficient session data analysis (length, keys, group_by, select, map, sort_by, unique, flat_map)
generate_pages Produce homepage + all session pages for preview

The jq_query tool is key for keeping token usage low — the AI analyzes data shape/counts without ingesting full session JSON into the conversation context.

Batch Note Creation (/api/create-notes)

SSE endpoint that streams progress events as notes are created:

POST /api/create-notes
→ data: {"phase":"creating-sessions","completed":3,"total":49,"current":"Talk Title",...}
→ data: {"phase":"creating-book","completed":48,...}
→ data: {"phase":"done","mainBookUrl":"https://hackmd.io/abc123",...}
  • Configurable delay between requests (default 300ms)
  • Auto 10s pause on 429 responses
  • Failed sessions are omitted from homepage links rather than leaving broken anchors

Frontend Components

  • setup-panel — credential entry + team verification
  • chat-panel — AI chat with file upload, tool invocation display
  • preview-panel — markdown preview with page selector
  • progress-modal — real-time creation progress with log output

Root README

Updated to document the new example alongside existing nodejs/ and book-mode-conference/ examples.

Copilot AI and others added 2 commits March 26, 2026 03:31
… and progress tracking

Co-authored-by: Yukaii <4230968+Yukaii@users.noreply.github.com>
Agent-Logs-Url: https://github.com/hackmdio/api-client/sessions/a73c91f7-229e-482d-b038-6bb8e454ab09
…, improve progress tracking

Co-authored-by: Yukaii <4230968+Yukaii@users.noreply.github.com>
Agent-Logs-Url: https://github.com/hackmdio/api-client/sessions/a73c91f7-229e-482d-b038-6bb8e454ab09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants